A candle is a common living appliance. A traditional candle has the problems of pollution and safety. In order to solve these problems, an electronic candle is derived accordingly. The electronic candle is environment-friendly and safe. However, the existing electronic candle only imitates the light of a candle, unable to provide a swinging flame effect like a real candle. The display effect of the electronic candle is not good, and the ornamental value is not high. Accordingly, the inventor of the present invention has devoted himself based on his many years of practical experiences to solve these problems.